﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    /// <summary>
    /// 基类
    /// </summary>
    [Table("X00")]
    public class EntityBase
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public EntityBase()
        {
            this.Id = Guid.NewGuid();
            this.CreateTime = DateTime.Now;
        }

        /// <summary>
        ///  唯一标识符
        /// </summary>
        [Key]
        [Required]
        [Column("X01")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Required]
        [Column("X02")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 锁定时间
        /// </summary>
        [Column("X03")]
        public DateTime? LockTime { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [Column("X04")]
        public DateTime? DeleteTime { get; set; }

    }
}
